//
//  AlphaBitmap.h
//  VisionGame
//
//  Created by aaronwang on 13-1-8.
//
//

#ifndef __QALPHABITMAP_H__
#define __QALPHABITMAP_H__


#include <QtGui/QImage>

#include "QtExt.h"


class QTEXT_DLL QAlphaBitmap
{
public:
    QAlphaBitmap(const QString &filename);
    QAlphaBitmap(int width, int height);
    ~QAlphaBitmap();
    
    int width() const
    {
        return mImage->width();
    }
    
    int height() const
    {
        return mImage->height();
    }
    
    int bytesPerLine() const
    {
        return mImage->bytesPerLine();
    }
    
    uchar *bits()
    {
        return mImage->bits();
    }
    
    const uchar *bits() const
    {
        return mImage->bits();
    }
    
    uchar *scanLine(int i)
    {
        return mImage->scanLine(i);
    }
    
    const uchar *scanLine(int i) const
    {
        return mImage->scanLine(i);
    }
    
    void fill(QAlphaBitmap *srcImage, const QPoint &pos);
    
	void save(const QString &fileName)
	{
		mImage->save(fileName, "BMP");
	}

protected:
    QImage  *mImage;
    quint32 *mData;
};


#endif  /*__QALPHABITMAP_H__*/
